Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check dispatcher on announcement and instruction events in ViewModel #1152

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

danesfeder
Copy link
Contributor

Found in CI:

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'com.mapbox.services.android.navigation.ui.v5.voice.SpeechAnnouncement com.mapbox.services.android.navigation.ui.v5.NavigationViewEventDispatcher.onAnnouncement(com.mapbox.services.android.navigation.ui.v5.voice.SpeechAnnouncement)' on a null object reference
com.mapbox.services.android.navigation.ui.v5.NavigationViewModel.playVoiceAnnouncement (NavigationViewModel.java:368)
com.mapbox.services.android.navigation.ui.v5.NavigationViewModel.access$700 (NavigationViewModel.java:47)
com.mapbox.services.android.navigation.ui.v5.NavigationViewModel$3.onMilestoneEvent (NavigationViewModel.java:282)
com.mapbox.services.android.navigation.v5.navigation.NavigationEventDispatcher.onMilestoneEvent (NavigationEventDispatcher.java:137)
com.mapbox.services.android.navigation.v5.navigation.RouteProcessorThreadListener.onMilestoneTrigger (RouteProcessorThreadListener.java:46)
com.mapbox.services.android.navigation.v5.navigation.RouteProcessorHandlerCallback$1.run (RouteProcessorHandlerCallback.java:98)

These NavigationViewDispatcherEvents were added in #1107 and were not accompanied with a null check. Every time we use the dispatcher in NavigationViewModel we need to double check it isn't null because we set it to null during rotation to prevent leaks from the NavigationView being destroyed.

@danesfeder danesfeder added bug Defect to be fixed. navigation-ui labels Jul 24, 2018
@danesfeder danesfeder added this to the 0.17.0 milestone Jul 24, 2018
@danesfeder danesfeder self-assigned this Jul 24, 2018
Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@danesfeder danesfeder merged commit ee3ce81 into master Aug 3, 2018
@danesfeder danesfeder deleted the dan-nav-vm-speech branch August 3, 2018 15:37
@Guardiola31337 Guardiola31337 mentioned this pull request Aug 10, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants